#!/bin/bash

VER=`cat src/VERSION | head -n 1`
GIT_VER=`git log | head -1 | awk '{print $2 }'`

echo 'VER='$VER
echo 'GIT_VER='$GIT_VER

OUTNAME=antpm_${VER}.orig.tar

FILES=`find . -type f -name \* -print | grep -v .git`
TMP_LIST=`mktemp`

#echo $FILES
#echo "TMP_LIST=${TMP_LIST}"
#echo ${FILES} > ${TMP_LIST}
#echo ${FILES} > dist-file-list

#find . -type f -name \* -print | grep -v .git > scripts/dist-file-list

rm -fv ${OUTNAME}.gz ${OUTNAME}.xz
tar -czvf ${OUTNAME}.gz -T scripts/origsrc-file-list
#tar --xz -cf ${OUTNAME}.xz -T scripts/origsrc-file-list

echo 'OK: ' ${OUTNAME}
